package com.tsll.controller;

import com.tsll.dao.BookMapper;
import com.tsll.entity.Book;
import com.tsll.service.BookService;
import com.tsll.service.impl.BookServiceImpl;
import com.tsll.service.impl.StaffServiceImpl;
import com.tsll.service.impl.UserServiceImpl;
import com.tsll.vo.EchartsVo;
import com.tsll.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("/statistics")
@RestController
public class StatisticsController {
    @Autowired
    private BookServiceImpl bookService;
    @Autowired
    private StaffServiceImpl service;
    @Autowired
    private UserServiceImpl userService;

//    查询实体书的数量
    @RequestMapping("/chart")
    public Result  selectbooks(){
        return   bookService.seleectbooks();
    }
    @RequestMapping("/getstaffshu")
    public Result selectstaff(){
        return  service.getstaffshu();
    }
    @RequestMapping("/getbookcount")
    public  Result getusercount(){
        return  userService.getusershu();
    }
//    统计流行的图书的数量
    @RequestMapping("/aaaa")
    public  Result getqqq( ){
        List<EchartsVo> getcount = bookService.getcount();
        System.out.println(getcount);
        return new Result(200,"查询成功",getcount);
    }
}
